var statut;

function UpdateOrdersShown()
{
	var NbChecks = document.getElementById("nb_check");
	
	for(var i = 0; i < NbChecks.value; i++)
	{
		var checkbox = document.getElementById("check_"+i);
		var orders = document.getElementsByName("ligne_order_s"+i);
		
		for (var n = 0, c = orders.length ; n < c ; n++)
			orders[n].style.display = (checkbox.checked ? "table-row" : "none");
	}
	
	return;
}

function ouvrir_palette(statut_, txt_)
{
	statut = statut_;
	window.open("palette.php?txt="+txt_,"Palette_de_couleur","height=380,width=400,status=0, scrollbars=0,,menubar=0");
}
 
function valid_couleur(couleur)
{
	var carre = document.getElementById("carre_"+statut);
	var orders = document.getElementsByName("ligne_order_s"+statut);
	
	carre.style.backgroundColor = couleur;
		
	for (var n = 0, c = orders.length ; n < c ; n++)
		orders[n].style.backgroundColor = couleur;
		
	GetPageContent('GET', 'functions/SetStatutColorByID.php?id='+statut+'&color='+(couleur.replace('#', '')), '', null, 'create', true);	
}

function valid_couleur_txt(couleur)
{
	var carre = document.getElementById("carretxt_"+statut);
	var orders = document.getElementsByName("ligne_order_s"+statut);
	
	carre.style.backgroundColor = couleur;
		
	for (var n = 0, c = orders.length ; n < c ; n++)
		orders[n].style.color = couleur;
		
	GetPageContent('GET', 'functions/SetStatutTxtColorByID.php?id='+statut+'&color='+(couleur.replace('#', '')), '', null, 'create', true);	
}